﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverlightApplication1.DataTypes
{
    public class TextLanguage
    {
        public enum fields
        {
            key_title,
            key_signin,
            key_change_used,
            search,
            lnk_language,
            btn_left_1,
            btn_left_2,
            btn_left_3,
            lnksearch_advanced,
            lnksearch_basic,
            adv_title,
            adv_sortby,
            adv_filteredby,
            adv_filt_author,
            adv_filt_publisher,
            adv_filt_title,
            adv_filt_category,
            adv_filt_cat_LF,
            adv_filt_cat_medicine,
            adv_filt_cat_MT,
            adv_filt_cat_nonfiction,
            adv_filt_cat_ON,
            adv_filt_condition,
            adv_filt_cond_all,
            adv_filt_cond_new,
            adv_filt_cond_used,
            adv_filt_cond_coll,
            adv_filt_cond_refu,
            adv_filt_keyword,
            adv_filt_maxprice,
            adv_filt_minprice,
            adv_sort_first,
            adv_sort_second,
            adv_sort_third,
            adv_sort_lprice,
            adv_sort_price_asc,
            adv_sort_price_dsc,
            adv_sort_price_ascending,
            adv_sort_price_descending,
            adv_sort_publication,
            adv_sort_title,
            adv_clean,
            adv_pag_of,
            adv_pag_noresult,
            adv_loading,
            invalidkey
        }

        public TextLanguage() { }

        public string GetText(TextLanguage.fields field, int language)
        {
            string text = "";
            switch (language)
            {
                case 1:
                    text = GetTextEnglish(field);
                    break;
                case 2:
                    text = GetTextSpanish(field);
                    break;
            }
            return text;
        }

        private string GetTextEnglish(fields field)
        {
            string text = "";

            switch (field)
            {
                case fields.key_title:
                    text = "Amazon Key";
                    break;
                case fields.key_signin:
                    text = "Sign In";
                    break;
                case fields.key_change_used:
                    text = "Change Key Used";
                    break;
                case fields.search:
                    text = "Search";
                    break;
                case fields.lnk_language:
                    text = "Español";
                    break;
                case fields.btn_left_1:
                    text = "";
                    break;
                case fields.btn_left_2:
                    text = "";
                    break;
                case fields.btn_left_3:
                    text = "";
                    break;
                case fields.lnksearch_advanced:
                    text = "Advanced Search";
                    break;
                case fields.lnksearch_basic:
                    text = "Basic Search";
                    break;
                case fields.adv_title:
                    text = "Advanced Search";
                    break;
                case fields.adv_sortby:
                    text = "Sort by";
                    break;
                case fields.adv_filteredby:
                    text = "Filtered by";
                    break;
                case fields.adv_filt_author:
                    text = "Author:";
                    break;
                case fields.adv_filt_publisher:
                    text = "Publisher:";
                    break;
                case fields.adv_filt_title:
                    text = "Title:";
                    break;
                case fields.adv_filt_category:
                    text = "Category:";
                    break;
                case fields.adv_filt_cat_LF:
                    text = "Literature and Fiction";
                    break;
                case fields.adv_filt_cat_medicine:
                    text = "Medicine";
                    break;
                case fields.adv_filt_cat_MT:
                    text = "Mystery and Thrillers";
                    break;
                case fields.adv_filt_cat_nonfiction:
                    text = "Nonfiction";
                    break;
                case fields.adv_filt_cat_ON:
                    text = "Nature";
                    break;
                case fields.adv_filt_condition:
                    text = "Condition:";
                    break;
                case fields.adv_filt_cond_all:
                    text = "All";
                    break;
                case fields.adv_filt_cond_new:
                    text = "New";
                    break;
                case fields.adv_filt_cond_used:
                    text = "Used";
                    break;
                case fields.adv_filt_cond_coll:
                    text = "Collectible";
                    break;
                case fields.adv_filt_cond_refu:
                    text = "Refurbished";
                    break;
                case fields.adv_filt_keyword:
                    text = "Keyword:";
                    break;
                case fields.adv_filt_maxprice:
                    text = "Maximum Price (U$S):";
                    break;
                case fields.adv_filt_minprice:
                    text = "Minimum Price (U$S):";
                    break;
                case fields.adv_sort_first:
                    text = "First by:";
                    break;
                case fields.adv_sort_second:
                    text = "Second by:";
                    break;
                case fields.adv_sort_third:
                    text = "Third by:";
                    break;
                case fields.adv_sort_lprice:
                    text = "List Price";
                    break;
                case fields.adv_sort_price_asc:
                    text = "asc";
                    break;
                case fields.adv_sort_price_dsc:
                    text = "desc";
                    break;
                case fields.adv_sort_price_ascending:
                    text = "ascending";
                    break;
                case fields.adv_sort_price_descending:
                    text = "descending";
                    break;
                case fields.adv_sort_publication:
                    text = "Publication";
                    break;
                case fields.adv_sort_title:
                    text = "Title";
                    break;
                case fields.adv_clean:
                    text = "clean";
                    break;
                case fields.adv_pag_of:
                    text = "of";
                    break;
                case fields.adv_pag_noresult:
                    text = "... No Result ...";
                    break;
                case fields.adv_loading:
                    text = "Loading...";
                    break;
                case fields.invalidkey:
                    text = "Invalid key";
                    break;
            }
            return text;

        }

        private string GetTextSpanish(fields field)
        {
            string text = "";

            switch (field)
            {
                case fields.key_title:
                    text = "Clave de Amazon";
                    break;
                case fields.key_signin:
                    text = "Registrarse";
                    break;
                case fields.key_change_used:
                    text = "Usar otra clave";
                    break;
                case fields.search:
                    text = "Buscar";
                    break;
                case fields.lnk_language:
                    text = "English";
                    break;
                case fields.btn_left_1:
                    text = "";
                    break;
                case fields.btn_left_2:
                    text = "";
                    break;
                case fields.btn_left_3:
                    text = "";
                    break;
                case fields.lnksearch_advanced:
                    text = "Búsqueda Avanzada";
                    break;
                case fields.lnksearch_basic:
                    text = "Búsqueda Normal";
                    break;
                case fields.adv_sortby:
                    text = "Ordenar por";
                    break;
                case fields.adv_filteredby:
                    text = "Filtrar por";
                    break;
                case fields.adv_filt_author:
                    text = "Autor:";
                    break;
                case fields.adv_filt_publisher:
                    text = "Editorial:";
                    break;
                case fields.adv_filt_title:
                    text = "Título:";
                    break;
                case fields.adv_filt_category:
                    text = "Categoría:";
                    break;
                case fields.adv_filt_cat_LF:
                    text = "Literatura y Ficción";
                    break;
                case fields.adv_filt_cat_medicine:
                    text = "Medicina";
                    break;
                case fields.adv_filt_cat_MT:
                    text = "Misterio y Suspenso";
                    break;
                case fields.adv_filt_cat_nonfiction:
                    text = "No ficción";
                    break;
                case fields.adv_filt_cat_ON:
                    text = "Naturaleza";
                    break;
                case fields.adv_filt_condition:
                    text = "Condición:";
                    break;
                case fields.adv_filt_cond_all:
                    text = "Todos";
                    break;
                case fields.adv_filt_cond_new:
                    text = "Nuevo";
                    break;
                case fields.adv_filt_cond_used:
                    text = "Usado";
                    break;
                case fields.adv_filt_cond_coll:
                    text = "Coleccionable";
                    break;
                case fields.adv_filt_cond_refu:
                    text = "Restaurado";
                    break;
                case fields.adv_filt_keyword:
                    text = "Clave:";
                    break;
                case fields.adv_filt_maxprice:
                    text = "Precio Máximo (U$S):";
                    break;
                case fields.adv_filt_minprice:
                    text = "Precio Mínimo (U$S):";
                    break;
                case fields.adv_sort_first:
                    text = "Primero:";
                    break;
                case fields.adv_sort_second:
                    text = "Segundo:";
                    break;
                case fields.adv_sort_third:
                    text = "Tercero:";
                    break;
                case fields.adv_sort_lprice:
                    text = "Precio";
                    break;
                case fields.adv_sort_price_asc:
                    text = "asc";
                    break;
                case fields.adv_sort_price_dsc:
                    text = "desc";
                    break;
                case fields.adv_sort_price_ascending:
                    text = "ascendente";
                    break;
                case fields.adv_sort_price_descending:
                    text = "descendente";
                    break;
                case fields.adv_sort_publication:
                    text = "Publicación";
                    break;
                case fields.adv_sort_title:
                    text = "Título";
                    break;
                case fields.adv_clean:
                    text = "limpiar";
                    break;
                case fields.adv_pag_of:
                    text = "de";
                    break;
                case fields.adv_pag_noresult:
                    text = "... Ningún resultado ...";
                    break;
                case fields.adv_loading:
                    text = "Cargando...";
                    break;
                case fields.invalidkey:
                    text = "Clave inválida";
                    break;
            }
            return text;
        }


        public string GetTextItemResult(string nameCtrl, int language)
        {
            if (language == 1)
            {
                return GetTextItemResultEn(nameCtrl);
            }
            else
            {
                return GetTextItemResultEs(nameCtrl);
            }
        }

        private string GetTextItemResultEn(string nameCtrl)
        {
            string text = "";

            switch (nameCtrl)
            {
                //Info
                case "lblRsltPublisher":
                    text = "Publisher";
                    break;
                case "lblRsltPrice":
                    text = "Price: ";
                    break;

                //Mre Info
                case "lblRsltMIPublisher":
                    text = "Publisher";
                    break;
                case "lblRsltMIPrice":
                    text = "Price: ";
                    break;
                case "lblRsltMILwstPrices":
                    text = "Lowest Prices";
                    break;
                case "lblRsltMILPNew":
                    text = "New: ";
                    break;
                case "lblRsltMILPUsed":
                    text = "Used: ";
                    break;
                case "lblRsltMILPCollectible":
                    text = "Collectible: ";
                    break;
                case "lblRsltMIPubDDate":
                    text = "Publication Date ";
                    break;
                case "lblRsltMIRelDate":
                    text = "Release Date ";
                    break;
                case "lblRsltMIISBN":
                    text = "ISBN ";
                    break;
            }

            return text;
        }

        private string GetTextItemResultEs(string nameCtrl)
        {
            string text = "";

            switch (nameCtrl)
            {
                //Info
                case "lblRsltPublisher":
                    text = "Editorial";
                    break;
                case "lblRsltPrice":
                    text = "Precio: ";
                    break;

                //Mre Info
                case "lblRsltMIPublisher":
                    text = "Editorial";
                    break;
                case "lblRsltMIPrice":
                    text = "Precio: ";
                    break;
                case "lblRsltMILwstPrices":
                    text = "Precios más bajos";
                    break;
                case "lblRsltMILPNew":
                    text = "Nuevo: ";
                    break;
                case "lblRsltMILPUsed":
                    text = "Usado: ";
                    break;
                case "lblRsltMILPCollectible":
                    text = "Coleccionable: ";
                    break;
                case "lblRsltMIPubDDate":
                    text = "Publicación ";
                    break;
                case "lblRsltMIRelDate":
                    text = "Presentado ";
                    break;
                case "lblRsltMIISBN":
                    text = "ISBN ";
                    break;
            }
            return text;
        }

    }
}
